package com.clw.classpath;

import com.clw.utils.FileUtil;
import java.io.IOException;
import java.util.List;

/**
 * Created by chengliwei on 2018/12/14.
 */
public class WildcardEntry implements Entry {

    private Entry entry;

    public WildcardEntry(String path) {
        String baseDir = path.substring(0, path.length() - 1);
        List<String> filePaths = FileUtil.walk(baseDir);
        this.entry = new CompositeEntry(filePaths);
    }

    @Override
    public byte[] readClass(String className) throws IOException {
        return entry.readClass(className);
    }
}
